package com.jkt.rms.business.base;

import java.lang.Comparable;
import java.io.Serializable;


/**
 * This is an object that contains data related to the rmsresource table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="rmsresource"
 */

public abstract class BaseResource  implements Comparable, Serializable {

	public static String REF = "Resource";
	public static String PROP_STATUS = "status";
	public static String PROP_RELEVANT_EXPERIENCE = "relevantExperience";
	public static String PROP_UPDATED_DATE = "updatedDate";
	public static String PROP_PERSONAL_DETAIL = "personalDetail";
	public static String PROP_UPDATED_BY = "updatedBy";
	public static String PROP_RESOURCE_ID = "resourceId";
	public static String PROP_PRIMARY_SKILL = "primarySkill";
	public static String PROP_SECONDARY_SKILL = "secondarySkill";
	public static String PROP_RESOURCE_CODE = "resourceCode";
	public static String PROP_LOCATION = "location";
	public static String PROP_TOTAL_EXPERIENCE = "totalExperience";
	public static String PROP_VENDOR = "vendor";


	// constructors
	public BaseResource () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseResource (int resourceId) {
		this.setResourceId(resourceId);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private int resourceId;

	// fields
	private java.lang.String resourceCode;
	private java.lang.String personalDetail;
	private java.lang.String primarySkill;
	private java.lang.String secondarySkill;
	private java.lang.String totalExperience;
	private java.lang.String relevantExperience;
	private java.util.Date updatedDate;
	private java.lang.String updatedBy;
	private char status;

	// many to one
	private com.jkt.rms.business.Vendor vendor;
	private com.jkt.rms.business.Location location;

	// collections
	private java.util.Set<com.jkt.rms.business.ResourceProjectLinkup> resourceProjectLinkups;
	private java.util.Set<com.jkt.rms.business.ResourceRoleLinkup> resourceRoleLinkups;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="assigned"
     *  column="resource_id"
     */
	public int getResourceId () {
		return resourceId;
	}

	/**
	 * Set the unique identifier of this class
	 * @param resourceId the new ID
	 */
	public void setResourceId (int resourceId) {
		this.resourceId = resourceId;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: resource_code
	 */
	public java.lang.String getResourceCode () {
		return resourceCode;
	}

	/**
	 * Set the value related to the column: resource_code
	 * @param resourceCode the resource_code value
	 */
	public void setResourceCode (java.lang.String resourceCode) {
		this.resourceCode = resourceCode;
	}



	/**
	 * Return the value associated with the column: personal_detail
	 */
	public java.lang.String getPersonalDetail () {
		return personalDetail;
	}

	/**
	 * Set the value related to the column: personal_detail
	 * @param personalDetail the personal_detail value
	 */
	public void setPersonalDetail (java.lang.String personalDetail) {
		this.personalDetail = personalDetail;
	}



	/**
	 * Return the value associated with the column: primary_skill
	 */
	public java.lang.String getPrimarySkill () {
		return primarySkill;
	}

	/**
	 * Set the value related to the column: primary_skill
	 * @param primarySkill the primary_skill value
	 */
	public void setPrimarySkill (java.lang.String primarySkill) {
		this.primarySkill = primarySkill;
	}



	/**
	 * Return the value associated with the column: secondary_skill
	 */
	public java.lang.String getSecondarySkill () {
		return secondarySkill;
	}

	/**
	 * Set the value related to the column: secondary_skill
	 * @param secondarySkill the secondary_skill value
	 */
	public void setSecondarySkill (java.lang.String secondarySkill) {
		this.secondarySkill = secondarySkill;
	}



	/**
	 * Return the value associated with the column: total_experience
	 */
	public java.lang.String getTotalExperience () {
		return totalExperience;
	}

	/**
	 * Set the value related to the column: total_experience
	 * @param totalExperience the total_experience value
	 */
	public void setTotalExperience (java.lang.String totalExperience) {
		this.totalExperience = totalExperience;
	}



	/**
	 * Return the value associated with the column: relevant_experience
	 */
	public java.lang.String getRelevantExperience () {
		return relevantExperience;
	}

	/**
	 * Set the value related to the column: relevant_experience
	 * @param relevantExperience the relevant_experience value
	 */
	public void setRelevantExperience (java.lang.String relevantExperience) {
		this.relevantExperience = relevantExperience;
	}



	/**
	 * Return the value associated with the column: updated_date
	 */
	public java.util.Date getUpdatedDate () {
		return updatedDate;
	}

	/**
	 * Set the value related to the column: updated_date
	 * @param updatedDate the updated_date value
	 */
	public void setUpdatedDate (java.util.Date updatedDate) {
		this.updatedDate = updatedDate;
	}



	/**
	 * Return the value associated with the column: updated_by
	 */
	public java.lang.String getUpdatedBy () {
		return updatedBy;
	}

	/**
	 * Set the value related to the column: updated_by
	 * @param updatedBy the updated_by value
	 */
	public void setUpdatedBy (java.lang.String updatedBy) {
		this.updatedBy = updatedBy;
	}



	/**
	 * Return the value associated with the column: status
	 */
	public char getStatus () {
		return status;
	}

	/**
	 * Set the value related to the column: status
	 * @param status the status value
	 */
	public void setStatus (char status) {
		this.status = status;
	}



	/**
	 * Return the value associated with the column: vendor_id
	 */
	public com.jkt.rms.business.Vendor getVendor () {
		return vendor;
	}

	/**
	 * Set the value related to the column: vendor_id
	 * @param vendor the vendor_id value
	 */
	public void setVendor (com.jkt.rms.business.Vendor vendor) {
		this.vendor = vendor;
	}



	/**
	 * Return the value associated with the column: location_id
	 */
	public com.jkt.rms.business.Location getLocation () {
		return location;
	}

	/**
	 * Set the value related to the column: location_id
	 * @param location the location_id value
	 */
	public void setLocation (com.jkt.rms.business.Location location) {
		this.location = location;
	}



	/**
	 * Return the value associated with the column: resourceProjectLinkups
	 */
	public java.util.Set<com.jkt.rms.business.ResourceProjectLinkup> getResourceProjectLinkups () {
		return resourceProjectLinkups;
	}

	/**
	 * Set the value related to the column: resourceProjectLinkups
	 * @param resourceProjectLinkups the resourceProjectLinkups value
	 */
	public void setResourceProjectLinkups (java.util.Set<com.jkt.rms.business.ResourceProjectLinkup> resourceProjectLinkups) {
		this.resourceProjectLinkups = resourceProjectLinkups;
	}

	public void addToresourceProjectLinkups (com.jkt.rms.business.ResourceProjectLinkup resourceProjectLinkup) {
		if (null == getResourceProjectLinkups()) setResourceProjectLinkups(new java.util.TreeSet<com.jkt.rms.business.ResourceProjectLinkup>());
		getResourceProjectLinkups().add(resourceProjectLinkup);
	}



	/**
	 * Return the value associated with the column: resourceRoleLinkups
	 */
	public java.util.Set<com.jkt.rms.business.ResourceRoleLinkup> getResourceRoleLinkups () {
		return resourceRoleLinkups;
	}

	/**
	 * Set the value related to the column: resourceRoleLinkups
	 * @param resourceRoleLinkups the resourceRoleLinkups value
	 */
	public void setResourceRoleLinkups (java.util.Set<com.jkt.rms.business.ResourceRoleLinkup> resourceRoleLinkups) {
		this.resourceRoleLinkups = resourceRoleLinkups;
	}

	public void addToresourceRoleLinkups (com.jkt.rms.business.ResourceRoleLinkup resourceRoleLinkup) {
		if (null == getResourceRoleLinkups()) setResourceRoleLinkups(new java.util.TreeSet<com.jkt.rms.business.ResourceRoleLinkup>());
		getResourceRoleLinkups().add(resourceRoleLinkup);
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jkt.rms.business.Resource)) return false;
		else {
			com.jkt.rms.business.Resource resource = (com.jkt.rms.business.Resource) obj;
			return (this.getResourceId() == resource.getResourceId());
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			return (int) this.getResourceId();
		}
		return this.hashCode;
	}

	public int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

	public String toString () {
		return super.toString();
	}


}